package CSDN.hzh22_7;

import java.util.Scanner;

/**
 * @Description:
 * @Author: Hanzao
 * @Date: 2022/07/11/16:23
 */
public class csdn_7_11_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int n = scanner.nextInt();
        int res = 0;
        for (int i = 0; i < n; i++) {
            if ((i + x) % 6 != 0 && (i + x) % 7 != 0) {
                res += 250;
            }
        }
        System.out.println(res);
    }
}
